<?php
/**
 * Created by PhpStorm.
 * User: xiaoshuang.li
 * Date: 2014/12/11
 * Time: 16:35
 */
add_theme_support( 'nav-menus' );
//add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
if(function_exists('register_nav_menus')){
    register_nav_menus( array(
        'header-menu' => __( 'nav' )
    ) );
}

//add post thumbnails
if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
}
if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'customized-post-thumb', 100, 120 );
}

function the_slug() {
    if(is_category()) {
        $cat = get_query_var('cat');
        $yourcat = get_category($cat);
        return 'category/'.$yourcat->slug;
    }
    $post_data = get_post($post->ID, ARRAY_A);
    $slug = $post_data['post_name'];
    return $slug.'/';
}